<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$title}</title>
<!-- Import google fonts - Heading first/ text second -->
<link rel='stylesheet' type='text/css' href='http://fonts.useso.com/css?family=Open+Sans:400,700|Droid+Sans:400,700' />
<link rel="shortcut icon" href="__PUBLIC__/admin/assets/ico/favicon.ico" type="image/x-icon" />
<link href="__PUBLIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/jquery.mmenu.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/font-awesome.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/plugins/jquery-ui/css/jquery-ui-1.10.4.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/style.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/add-ons.min.css" rel="stylesheet">
<script src="__PUBLIC__/admin/assets/js/jquery-2.1.1.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh_CN.js"></script>
<!--end 百度编辑器-->
</head>
<SCRIPT LANGUAGE=javascript>   
function p_del() {   
    var msg = "确定删除本文章吗?";   
	if (confirm(msg)==true){   
	return true;   
	}else{   
	return false;   
	}   
} 
$(function(){ 
	//全选
	$("#qx").click(function(){ 
	var inputs = $('#app').find('input');
	$(this).prop('checked') ? inputs.prop('checked','checked'):inputs.removeAttr('checked');
	});
	//end全选
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
		uploadJson : '{:U("Upload/images")}',
		fileManagerJson : '{:U("Upload/file_manager")}',
		allowFileManager : true,
    filterMode: false,//是否开启过滤模式
		extraFileUploadParams : {
		username : '<?php echo session("admin.username"); ?>',
		userid: '<?php echo session("admin.userid"); ?>',
		}
	  });
	    
		var uploadbutton = K.uploadbutton({
					button : K('#uploadButton')[0],
					fieldName : 'imgFile',
					url : '{:U("Upload/images")}',
					afterUpload : function(data) {
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							K('#url').val(url);
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton.fileBox.change(function(e) {
					uploadbutton.submit();
				});

		
	}); 
	
});
</SCRIPT>
<body>
<!-- start: Header --> 
<include file="./head" /> 
<!-- end: Header -->
<div class="container-fluid content">
  <div class="row"> 
    <!-- start: Main Menu --> 
    <include file="./slide" /> 
    <!-- end: Main Menu --> 
    <!-- start: Content -->
    <div class="main sidebar-minified">
      <div class="row">
        <div class="col-md-7">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h2><i class="fa fa-indent red"></i><strong>{$title}</strong></h2>
            </div>

            <div class="panel-body">

            <form action="{:U("Shop/news_add_update")}" method="post" enctype="multipart/form-data" class="form-horizontal ">
              <div class="form-group">
                <label class="col-md-2 control-label" for="text-input">文章标题</label>
                <div class="col-md-10">
                  <input type="text" id="title" name="title" class="form-control" placeholder="" value="{$news.title}">
                </div>
              </div>
              <div class="form-group">
                <label class="col-md-2 control-label" for="select">部署商品</label>
                <div class="col-md-4">
                  <select id="cid" name="cid" class="form-control" size="1">
                    <?php foreach($cate as $v): ?>
                    <option value="<?php echo $v['id']; ?>"><?php echo $v['title']; ?></option>
                    <?php endforeach;?>
                  </select>
                </div>
                <label class="col-md-2 control-label" for="select">部署域名</label>
                <div class="col-md-4">
                  <select id="yumi_id" name="yumi_id" class="form-control" size="1">
                    <?php foreach($yumi as $v): ?>
                    <option value="<?php echo $v['id']; ?>"><?php echo $v['url']; ?></option>
                    <?php endforeach;?>
                  </select>
                </div>
              </div>
              
              <div class="form-group">
                <label class="col-md-2 control-label" for="email-input">缩略图</label>
                <div class="col-md-8">
                  
                 <input class="btn form-control" value="{$news.litpic}" type="text" id="url" name="litpic" readonly style="  float:left; text-align:left" />          
                </div>
                      <div class="col-md-2">
                 <input type="button" id="uploadButton"  class="btn "  value="缩略图上传" style="width:24%; float:left" />
                 </div>
              </div>
 
  

              <div class="form-group">
                <label class="col-md-2 control-label" for="disabled-input">排序</label>
                <div class="col-md-10">
                  <input type="text" id="sort" name="sort" class="form-control" placeholder=""  value="99">
                </div>
              </div>
 
              <div class="form-group">
                <label class="col-md-2 control-label" for="textarea-input">文章内容</label>
                <div class="col-md-10">
                  <textarea  name="content" rows="9" style="width:100%; height:300px;"  placeholder="" id="content">{$news.content}</textarea>
                </div>
              </div>
              </div>
              <div class="panel-footer">
            <div class="row">
            <div class="col-md-2"></div>
            <div class="col-md-7">
              <button type="submit" class="btn btn-primary" style="float:left;width:200px;"><i class="fa fa-dot-circle-o"></i>提交</button>
             </div>   </div>
          </div>
 
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<include file="./foot" />
</body>
</html>